<html>
<head><meta charset="utf-8"><title>crates.io security advisory - 2020-07-14 · wg-secure-code · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/index.html">wg-secure-code</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/crates.2Eio.20security.20advisory.20-.202020-07-14.html">crates.io security advisory - 2020-07-14</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="203873754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/crates.io%20security%20advisory%20-%202020-07-14/near/203873754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tony Arcieri <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/crates.2Eio.20security.20advisory.20-.202020-07-14.html#203873754">(Jul 14 2020 at 19:06)</a>:</h4>
<p><a href="https://groups.google.com/forum/#!msg/rustlang-security-announcements/wc5d_Qq35RA/_uIQwK9ZBgAJ">https://groups.google.com/forum/#!msg/rustlang-security-announcements/wc5d_Qq35RA/_uIQwK9ZBgAJ</a></p>
<blockquote>
<p>Until recently, API keys for <a href="http://crates.io">crates.io</a> were generated using the PostgreSQL random function, which is not a cryptographically secure random number generator. This means that in theory, an attacker could observe enough random values to determine the internal state of the random number generator, and use this information to determine previously created API keys up to the last database server reboot.</p>
<p>As part of the investigation for this, we also found that API keys were being stored in plain text.</p>
</blockquote>
<p>Oh my...</p>



<a name="203885300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/crates.io%20security%20advisory%20-%202020-07-14/near/203885300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shnatsel <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/crates.2Eio.20security.20advisory.20-.202020-07-14.html#203885300">(Jul 14 2020 at 20:41)</a>:</h4>
<p>This reminds me, I'm sitting on a zero-day for most Linux desktops, I should go responsibly disclose it</p>



<a name="203885481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/crates.io%20security%20advisory%20-%202020-07-14/near/203885481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shnatsel <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/crates.2Eio.20security.20advisory.20-.202020-07-14.html#203885481">(Jul 14 2020 at 20:43)</a>:</h4>
<p>inb4 the hashing is just sha256 and not an actual KDF, and/or is not salted and peppered</p>



<a name="203885879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/crates.io%20security%20advisory%20-%202020-07-14/near/203885879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shnatsel <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/crates.2Eio.20security.20advisory.20-.202020-07-14.html#203885879">(Jul 14 2020 at 20:46)</a>:</h4>
<p>The current best practice for password storage is Argon2, right? Or did it change again?</p>



<a name="203886019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/crates.io%20security%20advisory%20-%202020-07-14/near/203886019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Gaynor <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/crates.2Eio.20security.20advisory.20-.202020-07-14.html#203886019">(Jul 14 2020 at 20:47)</a>:</h4>
<p>either of argon2 or scrypt will put you in the 99th percentile for responsible passwords</p>



<a name="203886156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/crates.io%20security%20advisory%20-%202020-07-14/near/203886156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Gaynor <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/crates.2Eio.20security.20advisory.20-.202020-07-14.html#203886156">(Jul 14 2020 at 20:48)</a>:</h4>
<p>I know it's unpleasant as heck, but huge props to the team for revoking every single key.</p>



<a name="203887934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/crates.io%20security%20advisory%20-%202020-07-14/near/203887934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shnatsel <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/crates.2Eio.20security.20advisory.20-.202020-07-14.html#203887934">(Jul 14 2020 at 21:03)</a>:</h4>
<p>Ah, they are using sha256 but they did think this through and their rationale seems sound to me: <a href="https://github.com/rust-lang/crates.io/pull/2637">https://github.com/rust-lang/crates.io/pull/2637</a></p>



<a name="203888831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/crates.io%20security%20advisory%20-%202020-07-14/near/203888831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Gaynor <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/crates.2Eio.20security.20advisory.20-.202020-07-14.html#203888831">(Jul 14 2020 at 21:10)</a>:</h4>
<p>Yeah, the API key hashing design matches what $work does.</p>



<a name="203905410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/crates.io%20security%20advisory%20-%202020-07-14/near/203905410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tony Arcieri <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/crates.2Eio.20security.20advisory.20-.202020-07-14.html#203905410">(Jul 15 2020 at 00:35)</a>:</h4>
<p>what they're doing is mostly fine</p>



<a name="203905423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/crates.io%20security%20advisory%20-%202020-07-14/near/203905423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tony Arcieri <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/crates.2Eio.20security.20advisory.20-.202020-07-14.html#203905423">(Jul 15 2020 at 00:35)</a>:</h4>
<p>if I had to nitpick I'd suggest a PRF but I don't have to nitpick so</p>



<a name="203905751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/crates.io%20security%20advisory%20-%202020-07-14/near/203905751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tony Arcieri <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/crates.2Eio.20security.20advisory.20-.202020-07-14.html#203905751">(Jul 15 2020 at 00:41)</a>:</h4>
<p>this whole thing did make me think it'd be good to read through the sensitive parts of the <a href="http://crates.io">crates.io</a> sources</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>